1. Technical Field
The present invention relates in general to a system and method of providing smart graphical components. In particular, the present invention provides components that automatically determine the appearance and behavior characteristics.
2. Description of the Related Art
Today's computing environment is dominated by graphical user interfaces (GUIs). GUIs contain various graphical components, or widgets, that perform an array of different functions. For example, an icon is a common graphical component that usually consists of an image and some descriptive text. When an icon is activated (clicked, invoked, selected, etc.) it will typically launch an application or another graphical component that provides information or exposes some set of functionality to the user.
The facilities that are needed to create GUIs are provided by the operating system. Such facilities usually include a method to draw to the screen, process events (e.g., mouse clicks, keyboard press events, etc.), and a base set of widgets. Modern operating systems provide these functions to application developers who use them to create graphical applications, such as Lotus Notes. Furthermore, the operating system itself often uses these facilities to provide a desktop environment to the user.
The Microsoft Windows™ and UNIX™ operating systems have included graphical facilities and a desktop environment since the 1980s.
Often times it is desireable to be able to place graphical components of the same type (e.g., icons) into different containers that appear on the display, such as toolbars, folders, and the like. Furthermore, it may be desirable for the component to vary it's appearance and behavior based upon the type of container in which it is located. For example, a toolbar is typically a small container usually nested inside of a larger container, such as a frame or a desktop. The size of the container, such as a toolbar, imposes size constraints on the graphical components that are included in the container. For example, when an icon is displayed inside of a desktop it may display both an image and descriptive text. However, if the same icon is placed in a different container, such as a toolbar, the developer may not wish to display the descriptive text in order to conserve space. Other behavior may also be different, such as whether a border is drawn around the graphical component when the user positions the mouse pointer over the object.
A challenge with graphical component placement is that such placement is often configurable by the user and, therefore, not known by the developer beforehand. Traditional systems address this challenge by providing similar, but different, graphical components that are added to the different containers. Likewise, behavior of the components in traditional systems is handled by the creation of similar, yet different, components.
For example, in traditional systems a toolbar-icon is created for placement in a toolbar while a desktop-icon is created for placement in a desktop. Developers using traditional systems and methods are challenged by the difficulty of moving graphical components from one type of container to another because of the different behavior and appearance attributes corresponding to the containers. What is needed, therefore, is a system and method that provides “smart” graphical components that detect their parent container type at runtime and adjust their behavior and appearance accordingly. What is further needed is a way to provide “smart” graphical components programmatically with code included with the component or through the use of a configuration file that is read and processed by the graphical component.